/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-03-12
 * Time: 18:07
 */
public class Test2 {
    public static void main1(String[] args) throws InterruptedException {
        Thread t = new Thread(){
            @Override
            public void run() {
                while(true) {
                    System.out.println("好耶 ^v^");
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException e) {//sleep抛出中断异常，我们要让jvm去安抚它~
                        e.printStackTrace();
                    }
                }
            }
        };
        t.start();
        while(true) {
            System.out.println("不要耶~~~");
            Thread.sleep(100);
        }
    }
}
